<template>
	<view class="container">
		<u-sticky offset-top="-44">
			<!-- <u-navbar leftIconSize="40" placeholder titleStyle="font-size:36rpx;font-weight:600;" title="账户记录" bgColor="#ffffff" :autoBack="true"></u-navbar> -->
			<view class="tab flex">
				<view class="tab-item flex1 flex ai_center jc_center" @click="tabChange(item.id)" :class="{active:tab==item.id}" v-for="(item,index) in tabList">{{item.title}}</view>
			</view>
		</u-sticky>
		<view class="list">
			<view class="bg-white radio-16">
				<view class="border-bottom pdx-20 pdy-28 flex ai_center jc_between" v-for="(item,index) in list">
					<view class="">
						<view class="text-28">{{tab==1?'创作收益':'提现'}}</view>
						<view class="mgt-16">
							<block v-if="tab==1">
								<view class="text-24 text-FF8A00" v-if="item.status==0">审核中</view>
								<view class="text-24 text-ED0000" v-if="item.status==1">提现失败</view>
								<view class="text-24 text-999" v-if="item.status>=2">提现成功</view>
							</block>
							<view class="text-24 text-999">{{item.createtime}}</view>
						</view>
					</view>
					<view class="text-36 text-b">
						{{tab==1?'+':index>=2?'-':''}}{{item.money}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tab:1,
				tabList:[{
					title:'收入',
					id:1,
				},{
					title:'提现',
					id:2
				}],
				list:[]
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			tabChange(tab){
				this.tab = tab
				this.getList()
			},
			getList(){
				this.get('workflow/log',{
					type:this.tab
				}).then(res=>{
					this.list = res.data.list.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		background-color: #f9f9f9;
		min-height: 100vh;
	}
.tab{
	height: 100rpx;
	background-color: #ffffff;
	&-item{
		font-size: 32rpx;
		color: #333333;
		&.active{
			color: #1CFFE5;
			position: relative;
			&::after{
				content:'';
				position: absolute;
				bottom: 0;
				left: 50%;
				transform: translateX(-50%);
				width: 108rpx;
				height: 4rpx;
				background: linear-gradient(270deg, #1CFFE5 0%, #79FFCD 100%);
				border-radius: 20rpx;
			}
		}
	}
}
.list{
	padding: 26rpx 28rpx;
}
.text-ED0000{
	color:#ED0000
}
.text-FF8A00{
	color:#FF8A00
}
</style>
